/**
 * Created by wei on 17/12/14.
 */

import React, { Component } from 'react';
import PropTypes from 'prop-types';

class Replay extends Component{

    constructor(props){
        super(props);
        this.state = {
            replay: this.props.replay,
            op: 10,
        }
    }


    componentWillReceiveProps(nextProps){
        const {replay, op} = nextProps;
        const opv = op ? op : 10;
        this.setState({
            replay:replay,
            op: opv,
        })
    }


    render(){

        return (
            <div className={'story2'}>
                <div className="tipfeng">
                    <div className={'format opac'+this.state.op} dangerouslySetInnerHTML={{__html: this.state.replay.content}}>

                    </div>
                </div>
            </div>

        );
    }


}

Replay.propTypes = {
    replay: PropTypes.object.isRequired,
    op: PropTypes.number,
};


export default Replay;